﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FlatRedBall;
using FlatRedBall.Graphics.Animation;
using FlatRedBall.Math.Geometry;
using ROMAP.Enums;

namespace ROMAP.Utilities
{
    public static class ExtensionMethods
    {
        public static void PixelScale(this Sprite spr)
        {
            float pixelsPerUnit = SpriteManager.Camera.PixelsPerUnitAt(spr.Z);
            spr.ScaleX = .5f * spr.Texture.Width / pixelsPerUnit;
            spr.ScaleY = .5f * spr.Texture.Height / pixelsPerUnit;
        }

        public static float PixelPerUnit(this Sprite spr)
        {
            return SpriteManager.Camera.PixelsPerUnitAt(spr.Z);
        }

        public static float ToFloat(this Layer l)
        {
            float result;

            result = (int)l * 0.1f;

            return result;
        }

        //public static void Destroy(this List<Trigger> slist)
        //{
        //    foreach (Trigger s in slist)
        //    {
        //        s.Destroy();
        //    }
        //}

        //public static void Destroy(this List<Obstacle> olist)
        //{
        //    foreach (Obstacle o in olist)
        //    {
        //        o.Destroy();
        //    }
        //}
    }
}